<cfparam name="template" default="">

<cfswitch expression="#template#">
	<cfcase value="workshopsListTemplate">
		<script id="workshopsListTemplate" type="text/x-kendo-tmpl">
			<tr>
				# if (authUser.role == "Super User" || authUser.role == "Regional Admin") { #
					<td>#= program_year#</td>
					<td>#= organization#</td>
				# } #
				<td>#= site#</td>
				<td>#= workshop_date# #= start_time# - #= end_time#</td>
				# if (authUser.role == "Super User" || authUser.role == "Regional Admin") { #
					<td>#= region_id#</td>
					
				# } #
				<td>#= evaluation_code#</td>
				<td>
					# if (approved == 1) { #
						Approved
					# } else { #
						Pending approval
					# } #
				</td>
				<td>
					# if (authUser.role == "Organizer") { #
						<div class="btn-group">
							<button class="btn btn-success" onclick="get('workshop', #= workshop_id#, 'edit', 'modal')">Edit</button>
							<button class="btn btn-success dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
							<ul class="dropdown-menu">
								<li><a onclick="confirmDel('workshop', #= workshop_id#)">Delete</a></li>
							</ul>
						</div>
					# } else { #
						<button class="btn btn-success" onclick="get('workshop', #= workshop_id#, 'edit', 'modal')">View</button>
					# } #
				</td>
			</tr>
		</script>
	</cfcase>
	<cfcase value="ordersListTemplate">
		<script id="ordersListTemplate" type="text/x-kendo-tmpl">
			<tr>
				<!--- <td>#= order_id#</td> --->
				<td>#= kendo.toString(kendo.parseDate(date_created), "d")#</td>
				<td>
					# if (anticipated_ship_date.length == 0) { #
						Not shipped
					# } else { #
						#= anticipated_ship_date#
					# } #
				</td>
				<td>
					# if (approved == 1) { #
						Approved
					# } else { #
						Pending
					# } #							
				</td>
				<td>
					# if (authUser.role == "Organizer") { #
						<div class="btn-group">
							<button class="btn btn-success" onclick="get('order', #= order_id#, 'edit', 'modal')">Edit</button>
							<button class="btn btn-success dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
							<ul class="dropdown-menu">
								<li><a onclick="confirmDel('order', #= order_id#)">Delete</a></li>
							</ul>
						</div>
					# } else { #
						<button class="btn btn-success" onclick="get('order', #= order_id#, 'edit', 'modal')">View</button>
					# } #
				</td>
			</tr>
		</script>
	</cfcase>
	<cfcase value="organizationsListTemplate">
		<script id="organizationsListTemplate" type="text/x-kendo-tmpl">
			<tr>
				<td>#= organization#</td>
				<td>#= address#</td>
				<td>#= city#</td>
			</tr>
		</script>
	</cfcase>
	<cfcase value="usersListTemplate">
		<script id="usersListTemplate" type="text/x-kendo-tmpl">
			<tr>
				<td>#= first_name# #= last_name#</td>
				<!--- <td>#= title#</td> --->
				<td>#= role#</td>
				<td>#= email#</td>
				<td>#= phone#</td>
				<td>
					# if (approved == 1) { #
						Approved
					# } else { #
						Not approved
					# } #
				</td>
				<td>
					<div class="btn-group">
						<button class="btn btn-success" onclick="get('user', #= user_id#, 'edit', 'modal')">Edit</button>
						<button class="btn btn-success dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
						<ul class="dropdown-menu">
							<li><a onclick="confirmDel('user', #= user_id#)">Delete</a></li>
						</ul>
					</div>
				</td>
			</tr>
		</script>
	</cfcase>
	<!--- <cfcase value="oapValuesListTemplate">
		<script id="oapValuesListTemplate" type="text/x-kendo-tmpl">
			<tr>
				<td><input type="checkbox" name="oapValueIDs" value="#= oap_value_id#"></td>
				<td>#= category#</td>
				<td>#= subcategory#</td>
				<td>#= description#</td>
			</tr>
		</script>
	</cfcase> --->
	<cfcase value="sitesListTemplate">
		<script id="sitesListTemplate" type="text/x-kendo-tmpl">
			<tr>
				<td>#= site#</td>
				<td>#= site_type#</td>
				<td>#= address#</td>
				<td>#= city#</td>
				<td>#= zip_code#</td>
				<td>#= county#</td>
				<td>#= computers#</td>
				<td>
					<div class="btn-group">
						<button class="btn btn-success" onclick="get('site', #= site_id#, 'edit', 'modal')">Edit</button>
						<button class="btn btn-success dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
						<ul class="dropdown-menu">
							<li><a onclick="confirmDel('site', #= site_id#)">Delete</a></li>
						</ul>
					</div>
				</td>
			</tr>
		</script>
	</cfcase>
	<cfcase value="workshopVolunteersListTemplate">
		<script id="workshopVolunteersListTemplate" type="text/x-kendo-tmpl">
			<tr>
				<td>#= first_name# #= last_name#</td>
				<td>
					#= site#<br>
					#= workshop_date# #= start_time# - #= end_time#
				</td>
				# if (confirmed) { #
					<td>Yes</td>
				# } else { #
					<td>No</td>
				# } #
				<!--- # if (acknowledged) { #
					<td>Yes</td>
				# } else { #
					<td>No</td>
				# } # --->
				<td>
					<div class="btn-group">
						<button class="btn btn-success" onclick="get('workshopVolunteer', #= workshop_volunteer_id#, 'edit', 'modal')">Edit</button>
						<button class="btn btn-success dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
						<ul class="dropdown-menu">
							<li><a onclick="confirmDel('workshopVolunteer', #= workshop_volunteer_id#)">Delete</a></li>
						</ul>
					</div>
				</td>
			</tr>
		</script>
	</cfcase>
	<cfcase value="oapsListTemplate">
		<script id="oapsListTemplate" type="text/x-kendo-tmpl">
			<tr>
				<td>#= oap_id#</td>
				<td>#= workshop_count#</td>
				<td>#= student_target#</td>
				<td>
					<div class="btn-group">
						<button class="btn btn-success" onclick="get('oap', #= oap_id#, 'edit', 'modal')">Edit</button>
						<button class="btn btn-success dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
						<ul class="dropdown-menu">
							<!--- <li><a onclick="print('oap', #= oap_id#)">Print</a></li> --->
						</ul>
					</div>
				</td>
			</tr>
		</script>
	</cfcase>
	<cfdefaultcase>
		The requested list template could not be found.
	</cfdefaultcase>
</cfswitch>